<?php
	namespace Util\Lang;
	class LangBridge{
		private $langctn = Array();
		function __construct(){}
		function get($id){
			$idm = explode(".", $id);
			if(!$this->langctn[$idm[0]]){
				if(file_exists($_SESSION['sys_dir']."/languages/".$_SESSION['sys_lang']."/".$idm[0].".xml")){
					$this->langctn[$idm[0]] = simplexml_load_file($_SESSION['sys_dir']."/languages/".$_SESSION['sys_lang']."/".$idm[0].".xml");
				}else{
					return false;
				}
			}
			$xpath = "//s[@mark='".$idm[1]."']";
			$value = $this->langctn[$idm[0]]->xpath($xpath);
			if(count($value)>0) {
				return $value[0];
			}
			else return false;
		}
	}
?>